import { axios } from '@/utils/request'

export const getUserPage = (params) => {
  return axios({
    url: 'user',
    method: 'get',
    params
  })
}

export const getUserById = (id) => {
  return axios({
    url: 'user/' + id,
    method: 'get'
  })
}

export const saveUser = (data) => {
  return axios({
    url: 'user',
    method: 'post',
    data
  })
}

export const updateUserById = (id, data) => {
  return axios({
    url: 'user/' + id,
    method: 'put',
    data
  })
}

export const removeUserById = (id) => {
  return axios({
    url: 'user/' + id,
    method: 'delete'
  })
}
